﻿using System;
using System.Collections.Generic;
using UnityEngine;

namespace H
{
	// Token: 0x02000269 RID: 617
	internal class H_State_ShowMouthLiquid : H_State
	{
		// Token: 0x06001038 RID: 4152 RVA: 0x00067F2C File Offset: 0x0006612C
		public H_State_ShowMouthLiquid(H_Members members) : base(members)
		{
		}

		// Token: 0x06001039 RID: 4153 RVA: 0x00067F38 File Offset: 0x00066138
		public override void In(H_State.Message msg)
		{
			List<Female> females = this.members.GetFemales();
			this.members.param.detail |= H_Parameter.DETAIL.SHOW_ORAL;
			bool flag;
			if (!females[0].IsFloped())
			{
				flag = (UnityEngine.Random.Range(0f, 1f) <= 0.3f);
			}
			else
			{
				flag = (UnityEngine.Random.Range(0f, 1f) <= 0.7f);
			}
			if (flag)
			{
				this.members.PlayAnime("ShowMouthLiquid", 0.5f);
			}
			else
			{
				this.members.PlayAnime("ExtractedWait", 0.5f);
			}
			this.members.VoiceExpression(H_Voice.TYPE.SHOW_ORAL);
		}

		// Token: 0x0600103A RID: 4154 RVA: 0x00067FF8 File Offset: 0x000661F8
		public override void Main()
		{
			this.UpdateVoice();
		}

		// Token: 0x0600103B RID: 4155 RVA: 0x00068000 File Offset: 0x00066200
		public override void Out()
		{
			if ((this.members.param.detail & H_Parameter.DETAIL.SHOW_ORAL) != H_Parameter.DETAIL.NO)
			{
				this.members.param.detail ^= H_Parameter.DETAIL.SHOW_ORAL;
			}
		}

		// Token: 0x0600103C RID: 4156 RVA: 0x00068034 File Offset: 0x00066234
		private void UpdateVoice()
		{
			List<Female> females = this.members.GetFemales();
			for (int i = 0; i < females.Count; i++)
			{
				if (!females[i].IsVoicePlaying())
				{
					this.members.VoiceExpression(i, H_Voice.TYPE.BREATH);
				}
			}
		}

		// Token: 0x0600103D RID: 4157 RVA: 0x00068084 File Offset: 0x00066284
		public override void OnInput(H_INPUT input)
		{
			if (input == H_INPUT.VOMIT)
			{
				base.ChangeState(H_STATE.VOMIT, null);
			}
			else if (input == H_INPUT.DRINK)
			{
				base.ChangeState(H_STATE.DRINK, null);
			}
		}
	}
}
